package pratice;

public class Test {
    public static void main(String args[]) {
       Student students[] = new Student[5];
       students[0] = new Student("001", "zhang", 90, 90, 90);
       students[1] = new Student("002", "wang", 80, 80, 80);
       students[2] = new Student("003", "li", 70, 70, 70);
       students[3] = new StudentXW("004", "zhao", 90, 90, 90,"XW");
       students[4] = new StudentBZ("005", "chen", 80, 80, 80,"BZ");

      // for(int i = 0; i < students.length; i++) {
        //   System.out.println(students[i].toString());
          // System.out.println("total score"+students[i].sum());
          // System.out.println("average score:"+students[i].testScore());
          // System.out.println("*****************************************************************************************");
       //}

       for(Student stu : students) {//foreach
           System.out.println(stu.toString());
           System.out.println("total score"+stu.sum());
           System.out.println("average score:"+stu.testScore());

       }

    }
}
